#!/usr/bin/python
"""Recorders agents.
    Marina -- Min1
    Gabriela -- Daily
    Gustavo -- Weekly
    Hamilton -- Monthly
    Antonio -- Bimonthly
"""

import recorder
from misc import misc
import agent
from datetime import datetime
import misc.quoteperiod as qp
from system import tradezone
import system.navalasystem as na
from system import configs as con

_aa = [("Marina", "min1"),
       ("Gabriela", "daily"),
       ("Gustavo", "weekly"),
       ("Zeh", "monthly"),
       ("Antonio", "bimonthly"),
       ("Miau", "quarterly"),
       ("Rama", "semesterly"),
       ("Felicio", "yearly"),
      ]

temp = con.fig.GetRaw("workStocksets")
for (name, period) in _aa:
    s = """
def {0}():
    r = recorder.{2}Recorder(name="{0}")
    r.infoGetter = tradezone.GetHTTPClientProxy()
    r.SetStocksets(temp)
    return r
recorder_{1} = {0} # More "objective" name
""".format(name, period, period.capitalize())
    exec(s)
